package com.ucar.umock.client.app.action;


import com.ucar.umock.client.app.remotesupport.VehicleRemoteSupport;
import com.ucar.umock.client.app.remotesupport.dto.VehicleInfoDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName MockAction
 * @Description TODO
 * @Author zhanbs baoshan.zhan@ucarinc.com
 * @Date 2020/4/2 14:37
 * @Version 1.0
 **/
@RestController
public class MockAction {


    @Autowired
    private VehicleRemoteSupport vehicleRemoteSupport;



    @RequestMapping(value="/mockDemoObj")
    @ResponseBody
    public Map<String,Object> mockDemoObj(){
        VehicleInfoDTO dto=vehicleRemoteSupport.getVehicleById(0l);
        Map<String,Object> rs=new HashMap<String, Object>();
        rs.put("flag","true");
        rs.put("msg","操作成功");
        rs.put("data",dto);
        return rs;
    }
    @RequestMapping(value="/mockDemoVoid")
    @ResponseBody
    public Map<String,Object> mockDemoVoid(){
        vehicleRemoteSupport.updateVehicleWorkStatus(0l,null);
        Map<String,Object> rs=new HashMap<String, Object>();
        rs.put("flag","true");
        rs.put("msg","操作成功");
        return rs;
    }
}
